package org.qiyu.live.msg.provider.config;

import java.util.concurrent.*;

/**
 * @Author idea
 * @Date: Created in 17:38 2023/6/11
 * @Description
 */
public class ThreadPoolManager {

    public static ThreadPoolExecutor commonAsyncPool = new ThreadPoolExecutor(
            2,
            8,
            3,
            TimeUnit.SECONDS,
            new ArrayBlockingQueue<>(1000),
            new ThreadFactory() {
                @Override
                public Thread newThread(Runnable runnable) {
                    Thread newThread = new Thread(runnable);
                    newThread.setName("commonAsyncPool - " + ThreadLocalRandom.current().nextInt(10000));
                    return newThread;
                }
    });

}